//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Spreadsheet
{
    class DoubleUtil
    {
        public static bool TryParsePossible(string s, out double value)
        {
            if (!TryParse(s, out value))
                return false;
            if (s.Split('.').Length > 2)
                return false;
            return true;
        }
        public static bool TryParse(string s, out double result)
        {
            if (s.IndexOf(' ') >= 0)
                s = s.Replace(" ", "");
            return double.TryParse(s, out result);
        }
    }
}
